package cn.sdhuijin.mediaplatform.components;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;

/**
 * @author sunp@sdhuijin.cn:
 * @version 创建时间：2015年3月25日 下午4:09:57 类说明
 */
public class CustomVideoView extends VideoView {

	private int mVideoWidth;
	private int mVideoHeight;

	public CustomVideoView(Context context) {
		super(context);
	}

	public CustomVideoView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public CustomVideoView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		int width = getDefaultSize(mVideoWidth, widthMeasureSpec);
		int height = getDefaultSize(mVideoHeight, heightMeasureSpec);
		setMeasuredDimension(width, height);
	}

	/**
	 * @return the mVideoWidth
	 */
	public int getmVideoWidth() {
		return mVideoWidth;
	}

	/**
	 * @param mVideoWidth
	 *            the mVideoWidth to set
	 */
	public void setmVideoWidth(int mVideoWidth) {
		this.mVideoWidth = mVideoWidth;
	}

	/**
	 * @return the mVideoHeight
	 */
	public int getmVideoHeight() {
		return mVideoHeight;
	}

	/**
	 * @param mVideoHeight
	 *            the mVideoHeight to set
	 */
	public void setmVideoHeight(int mVideoHeight) {
		this.mVideoHeight = mVideoHeight;
	}

}
